<!--
  #%L
  thinkbig-ui-operations-manager
  %%
  Copyright (C) 2017 ThinkBig Analytics
  %%
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  
      http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  #L%
  -->

<div layout="row" layout-sm="column" layout-xs="column"   ng-if="vm.loading == false">
    <div layout="column" flex="100" flex-gt-sm="70" flex-order="1" flex-order-xs="2" flex-order-sm="2" >
            <tba-feed-activity  feed-name="vm.feedName"></tba-feed-activity>
      <tba-jobs hide-feed-column="true" card-title='{{"views.feeds.feed-details.Jobs" | translate}}' feed-filter="vm.feedName" feed="vm.feed"
                page-name="feed-job-details" on-job-action="vm.onJobAction(action,job)"></tba-jobs>
    </div>

    <div layout="column"  flex="100"  flex-gt-sm="30"  style="margin:8px;" flex-order="2" flex-order-xs="1" flex-order-sm="1">
        <card-layout body-css="job-details-right-body">
            <header-section transclude-to="head">
                <div style="white-space:nowrap" class="card-title" flex>{{"views.feeds.feed-details.FD" | translate}}</div>
                </header-section>
            <body-section transclude-to="body">
                <md-content flex md-scroll-y>
                <md-list flex layout-fill class="feed-details-list list-item-table">
                <md-list-item>
                    <div layout="column"  class="item-column md-list-item-text ">
                      <span class="item-title">
                          {{vm.feedName}}
                      </span>
                      <div layout="row" layout-align="space-between center"
                            class="{{vm.feed.iconstyle}} column-title-bottom">
                          <div>
                              <ng-md-icon icon="{{vm.feed.icon}}" size="20"
                                      ng-if="vm.feed.icon"></ng-md-icon>
                                {{vm.feed.healthText | translate}}
                          </div>
                      </div>
                    </div>
                    </md-list-item>
                <md-divider></md-divider>

                <md-list-item>
                    <div layout="column"  class="item-column md-list-item-text ">

                                   <span  class="item-title" ng-class="{'healthy':vm.feed.displayStatus == 'COMPLETED' || vm.feed.displayStatus =='RUNNING','error':vm.feed.displayStatus == 'FAILED'}">
                                     {{vm.feed.displayStatus | translate}}</span>
                                     <span class="column-title column-title-bottom">
                                     {{"views.feeds.feed-details.Status" | translate}}
                                   </span>
                        </div>
                </md-list-item>
                <md-divider></md-divider>

                <md-list-item >
                    <div layout="column"  class="item-column md-list-item-text ">
                                    <span class="item-title">
                                        <kylo-timer start-time="vm.feed.timeSinceEndTime"></kylo-timer>
                                   </span>
                        <span class="column-title column-title-bottom">{{"views.feeds.feed-details.Since" | translate}}</span>
                        </div>
                </md-list-item>
                <md-divider></md-divider>

                <md-list-item >
                    <div layout="column"  class="item-column md-list-item-text ">
                        <span class="item-title">{{vm.feed.runTimeString}}</span>
                        <span class="column-title column-title-bottom">{{"views.feeds.feed-details.LRT" | translate}}</span>
                        </div>
                </md-list-item>
                    </md-list>

                  <md-divider></md-divider>

                  <div layout="column" class="layout-padding-top-bottom layout-padding-left-right"  layout-align="space-between start">
                    <!-- <div class="md-subhead layout-padding-bottom">Links</div> -->
                    <div class="layout-padding-left ">
                    <md-button class="md-primary md-link" ng-click="vm.gotoFeedDetails($event)">{{"views.feeds.feed-details.FeedD" | translate}}</md-button>
                    </div>
                  </div>


                </md-content>
            </body-section>
        </card-layout>
        <tba-alerts feed-name="{{vm.feedName}}" style="margin-left:8px;" >
        </tba-alerts>
    </div>

</div>

<div layout="row" layout-sm="column" layout-xs="column"   ng-if="vm.loading == true">
      <md-card layout-fill>
        <div layout="column" layout-align="center center" flex>
          <h2 class="md-title">{{"views.feeds.feed-details.LF" | translate}}</h2>
        <div layout-align="center center" layout="column">
          <md-progress-circular md-mode="indeterminate" md-diameter="30"></md-progress-circular>
        </div>
        </div>
      </md-card>

</div>
